var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("AssetsManager"),
    s = cc._decorator,
    l = s.ccclass,
    c = s.property,
    d = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.player_hand_sprite = null), (t.player_name_label = null), (t.player_level_sprite = null), t;
        }
        return (
            __extends(t, e),
            (t.prototype.initView = function () {
                this.showPlayerInfo();
            }),
            (t.prototype.addEvent = function () {
                this.attachEvent(a.default.SEND_UPDATE_PLAYER_INFO, this.showPlayerInfo, this);
            }),
            (t.prototype.showPlayerInfo = function () {
                var e = i.GlobalParams.PlayerInfo.value;
                (this.player_hand_sprite.spriteFrame = r.default.getInstance().getPlayerHeadFrame(e.head)),
                    (this.player_name_label.string = "" + e.name),
                    (this.player_level_sprite.spriteFrame = r.default
                        .getInstance()
                        .getPlayerLevelExp(e.level > 28 ? 28 : e.level));
                for (var t = 0; t < 4; t++) this.player_level_sprite.node.children[t].children[0].active = t <= e.exp;
            }),
            __decorate([c(cc.Sprite)], t.prototype, "player_hand_sprite", void 0),
            __decorate([c(cc.Label)], t.prototype, "player_name_label", void 0),
            __decorate([c(cc.Sprite)], t.prototype, "player_level_sprite", void 0),
            __decorate([l], t)
        );
    })(n.default);
o.default = d;
